﻿%page inherit Index;

%using Sito.Model;

%override Body
<div class="content" style="background-color:{%rand_color()%};">
    % var admin = (session("User") != null && session("User").Status == User.UserStatus.Admin);
    % Sito.Model.Bug bug = args(0);

    % if(admin)
        <form action="/assistance/change" method="post">
        <input type="hidden" value="{% bug.Guid %}" name="guid" />
    % end if
    
    <h1>Ticket N° {% bug.Guid %}</h1>
    % if(admin)
        <input type="submit" value="Save changes" />
    % end if
    <br /><h2>Author:</h2>{% bug.Author %}
    <br/><h2>Priority:</h2>{% bug.Priority %}
    % if(admin)
         <select name="priority">
             <option value="Proposal">Proposal</option>
             <option value="Low">Low</option>
             <option value="Med">Med</option>
             <option value="High">High</option>
             <option value="Emergency">Emergency</option>
         </select>
         <br />
    % end if

    <br/><h2>Date:</h2>{% bug.Date %}
    <br/><h2>Status:</h2>{% bug.Status %}
    % if(admin)
         <select name="status">
             <option value="Proposal">Assigning</option>
             <option value="Low">Evaulting</option>
             <option value="Med">Fixing</option>
             <option value="High">Fixed</option>
             <option value="Emergency">Emergency</option>
         </select>
         <br />
    % end if
    <br/><h2>Assigned to:</h2> {% bug.AssignedTo %}
    % if(admin)
         <input type="text" name="assignedto" />
         <br />
         </form>
    % end if

    <br /><h2>Description:</h2>
    {% bug.Description %}<br />
    <br />
    <h2>Changes:</h2>
    <ul>
        %foreach(var c in bug.Changes)
            <li>{% c %}</li>
        %end foreach
    </ul>
</div>

%end override 